package com.powervision.mvvmdemo.ui.viewmodel

import com.powervision.base.base.BaseViewModel
import com.powervision.http.observer.StateLiveData
import com.powervision.mvvmdemo.ui.model.ArticleListModel
import com.powervision.mvvmdemo.ui.repository.ListProjectRepository

/**
 * @auth: njb
 * @date: 2021/12/24 13:49
 * @desc: 描述
 */
class ListProjectViewModel :BaseViewModel(){
    private val mListProjectRepository by lazy { ListProjectRepository() }

    val mListProjectLiveData = StateLiveData<ArticleListModel>()

    fun listProject(page:Int){
        launchWithLoading(
            requestBlock = {
                mListProjectRepository.listProject(page)
            },
            resultCallback = {
                mListProjectLiveData.value = it
            }
        )
    }
}